package kevin.ecstorm.pdd.rest;

import com.pdd.pop.sdk.http.api.request.*;
import com.pdd.pop.sdk.http.api.response.*;
import kevin.ecstorm.pdd.config.PddAppAuth;
import kevin.ecstorm.pdd.service.IPddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ©Copyright ©1968-2020 Midea Group,IT
 * FileName: PddRefundRest
 * Author: kevin
 * Date: 2020年04月22日 21:05:27
 * Description: PddRefundRest服务接口
 */
@RestController
@RequestMapping("/pdd")
public class PddRefundRest {
    @Autowired
    private IPddService pddService;
    @Autowired
    private PddAppAuth auth;

    /**
     * 退货入库通知拼多多确认入库成功
     *
     * @param param
     * @return
     */
    @PostMapping("/order/information/get")
    public PddNextoneLogisticsWarehouseUpdateResponse pddNextoneLogisticsWarehouseUpdateResponse(PddNextoneLogisticsWarehouseUpdateRequest param) {
        return pddService.syncInvoke(param, auth);
    }

    /**
     * 用于未发货仅退款服务商通知拼多多PG取消成功
     *
     * @param param
     * @return
     */
    @PostMapping("/nextone/logistics/warehouse/update")
    public PddRdcPddgeniusSendgoodsCancelResponse pddRdcPddgeniusSendgoodsCancelResponse(PddRdcPddgeniusSendgoodsCancelRequest param) {
        return pddService.syncInvoke(param, auth);
    }

    /**
     * 获取商家退货地址库
     *
     * @param param
     * @return
     */
    @PostMapping("/refund/address/list/get")
    public PddRefundAddressListGetResponse pddRefundAddressListGet(PddRefundAddressListGetRequest param) {
        return pddService.syncInvoke(param, auth);
    }

    /**
     * 查询单个售后单详情
     *
     * @param param
     * @return
     */
    @PostMapping("/refund/information/get")
    public PddRefundInformationGetResponse pddRefundInformationGet(PddRefundInformationGetRequest param) {
        return pddService.syncInvoke(param, auth);
    }

    /**
     * 售后列表增量查询
     *
     * @param param
     * @return
     */
    @PostMapping("/refund/list/increment/get")
    public PddRefundListIncrementGetResponse pddRefundListIncrementGet(PddRefundListIncrementGetRequest param) {
        return pddService.syncInvoke(param, auth);
    }

    /**
     * 用于未发货仅退款服务商通知拼多多PG取消成功
     *
     * @param param
     * @return
     */
    @PostMapping("/refund/status/check")
    public PddRefundStatusCheckResponse pddRefundStatusCheck(PddRefundStatusCheckRequest param) {
        return pddService.syncInvoke(param, auth);
    }
}
